<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>title</title>
  <link rel="icon" type="image/png" href="logo.png">
  <link rel="stylesheet" type="text/css" href="../src/scss/initilization.css">
  <script type="text/javascript" src="../src/javascript/initilization.js"></script>
  <script src = "../src/javascript/pack.js" ></script>
  <script src="//cdn.bootcss.com/require.js/2.2.0/require.min.js"></script>
  <script type="text/javascript">
    require.config({
      paths: {
        'vue': '//cdn.bootcss.com/vue/1.0.26/vue.min',
        'vue-router': '//cdn.bootcss.com/vue-router/2.0.0-rc.1/vue-router.min',
        'marked': '//cdn.bootcss.com/marked/0.3.6/marked.min',
      }
    })
  </script>
  <!-- index -->
  <script type="text/javascript" src="index/index.js"></script>
  <link rel="stylesheet" type="text/css" href="index/index.css">
</head>
<body>
  <!-- loading -->
<div id="loading">
  <div></div>
  <div></div>
  <div></div>
</div>
  <!-- vue -->
  <div id="vue" v-cloak>
    <!-- header -->
    <div id="header">
      <div class="posts">
        <div class="post-title new-post" v-on:click="goPost(getNewPostID())">+</div>
        <div class="post-title"
          v-for="pt in posts"
          v-text="pt.id"
          v-on:click="goPost(pt.id, $event)"
          :class="{active: post.id===pt.id}"></div>
      </div>
      <div class="version" :class="{different: different}" v-on:click="methodSave"></div>
      <div id="user">
        <div class="login-btn" v-if="!user.authData">
          <span class="txt" v-on:click="userLogin">登录</span>
          <div class="login-data">
            <span>帐号：</span><input type="email" placeholder="test@imconfig.com" v-model="user.email" autocomplete="on">
          </div>
          <div class="login-data">
            <span>密码：</span><input type="password" v-model="user.password" v-on:keyup.enter="userLogin">
          </div>
        </div>
        <div class="user-model" v-if="user.authData">
          <div class="user-email" v-text="user.nick||user.authData.password.email" v-on:click="setNick"></div>
          <div class="user-load" v-on:click="postDownload">下载</div>
          <div class="user-publish" v-on:click="postUpload">上传</div>
        </div>
      </div>
    </div>
    <!-- editor -->
    <div id="editor">
      <textarea
        class="marked-input"
        v-model="edit.content"
        debounce="300"
        v-on:keyup="methodKeyup"
        v-on:keydown="methodKeydown"
        spellcheck="false"></textarea>
      <div class="marked-html" v-html="edit.content | marked"></div>
    </div>
  </div>
</body>
</html>